﻿using Microsoft.FxCop.Sdk;
using System;
using System.Collections.Generic;
using System.Linq;

namespace MyCustomRules
{
    public class DetectMethodRule : BaseIntrospectionRule
    {
        public DetectMethodRule()
            : base(typeof(DetectMethodRule).Name, "MyCustomRules.Metadata", typeof(DetectMethodRule).Assembly)
        {
        }

        public override ProblemCollection Check(Member member)
        {
            var method = member as Method;
            if (method == null)
            {
                return null;
            }

            var resolution = GetResolution();
            Problems.Add(new Problem(resolution, method));
            return Problems;
        }
    }
}
